﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ex05.MemoryGameLogic
{
    public class Cell
    {
        private int m_Row;
        private int m_Column;

        public int Row
        {
            get { return m_Row; }
            set { m_Row = value; }
        }

        public int Column
        {
            get { return m_Column; }
            set { m_Column = value; }
        }

        public Cell(int i_Row, int i_Column)
        {
            m_Row = i_Row;
            m_Column = i_Column;
        }

        public override bool Equals(object obj)
        {
            bool equals = false;

            Cell cell = obj as Cell;

            if (cell != null)
            {
                if (m_Row == cell.m_Row && m_Column == cell.m_Column)
                {
                    equals = true;
                }
            }

            return equals;
        }

        public override int GetHashCode()
        {
            return m_Row + (10 * m_Column);
        }
    }
}
